import Observer from "./Observer"
/**
 * 给对象变量（即obj）添加一个__ob__的观察者
 * @param {*} obj 
 * @returns 
 */
export default function observe(value) {
  
  if (typeof value != 'object') return
  let ob 
  if (typeof value.__ob__ !== 'undefined') {
    ob = value.__ob__
  } else {
    ob = new Observer(value)
  }
  return ob
}